home *** CD-ROM | disk | FTP | other *** search
/ DOpus Plus / DOpus Plus.iso / Tutorial / ARexx Tutorial / TuteRexx / ParseAminetRecent.dopus5 < prev    next >
Text File  |  1998-09-23  |  1KB  |  56 lines

  1. /* ParseAminetRecent.dopus5 */
  2. lf = '0a'x
  3. interesting = 'biz/dopus hard/hack util/dtype sex beer money'
  4.  
  5. options results
  6. address 'DOPUS.1'
  7.  
  8. if ~show('p','MIAMI.1') then do
  9.   address command 'Miami:Miami'
  10.   WaitForPort 'MIAMI.1'
  11.   if ~show('p','MIAMI.1') then do
  12.     dopus request '"Unable to run Miami!" OK'
  13.     exit
  14.     end
  15.   end
  16.  
  17. flag = 0
  18. address 'MIAMI.1' 'ISONLINE'
  19. if rc then flag = 1             /* see if Miami is already online */
  20. do while flag = 0
  21.   address 'MIAMI.1' 'ONLINE'
  22.   address 'MIAMI.1' 'ISONLINE'
  23.   if rc then flag = 1
  24. end
  25.  
  26. lister new
  27. handle = result
  28. lister set handle source
  29. 'command wait ftpconnect lister 'handle' host ftp.livewire.com.au dir /pub/aminet noscan recon'
  30.  
  31. command source handle original wait 'copy name=RECENT to=RAM:'
  32.  
  33. lister close handle
  34. command ftpquit
  35. if flag = 2 then address 'MIAMI.1' 'OFFLINE'
  36.  
  37. if ~open('infile','RAM:RECENT','R') then do
  38.   dopus request '"Cannot open RECENT file!" OK'
  39.   exit
  40.   end
  41.  
  42. text = 'Found these interesting files:'
  43. do while ~eof('infile')
  44.   aline = readln('infile')
  45.   do i = 1 to words(interesting)
  46.     if index(aline, word(interesting,i)) > 0 then do
  47.       text = text||lf||aline
  48.       leave
  49.       end
  50.   end
  51. end
  52. call close('infile')
  53.  
  54. dopus request '"'text'" OK'
  55. exit
  56.